package cn.acewill.yxd.yunxundian.ui.schedule;

import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;

import cn.acewill.yxd.yunxundian.BaseActivity;
import cn.acewill.yxd.yunxundian.R;

/**
 * Created by AAA on 2017/4/18.
 */

public class ScheduleAddOtherActivity extends BaseActivity implements View.OnClickListener{

    private RelativeLayout remarkRe;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setTitleBar("添加其他");
        setContentView(R.layout.schedule_addother);
        super.onCreate(savedInstanceState);
        initView();
    }

    public void initView(){
        Button sureBtn = (Button) findViewById(R.id.sureBtn);
        sureBtn.setVisibility(View.GONE);
        RelativeLayout restRe = (RelativeLayout) findViewById(R.id.restRe);
//        this.remarkRe= (RelativeLayout) findViewById(R.id.remarkRe);
        restRe.setOnClickListener(this);
        RelativeLayout remarkRe = (RelativeLayout)findViewById(R.id.remarkRe);
        remarkRe.setOnClickListener(this);
        RelativeLayout zidingyiRL = (RelativeLayout)findViewById(R.id.zidingyiRL);
        zidingyiRL.setOnClickListener(this);
        View backBtn = findViewById(R.id.backBtn);
        backBtn.setOnClickListener(this);
//        this.remarkRe.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.restRe:
                //日程
                startActivity(new Intent(this,ScheduleAddHoliday.class));
                break;
            case R.id.remarkRe:
                //备注
                startActivity(new Intent(this,editBeizhu.class));
                break;
            case R.id.zidingyiRL:
                //自定义任务
                startActivity(new Intent(this,zidingyiAdd.class));
                break;
            case R.id.backBtn:
                setResult(102);
                finish();
                break;
        }
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode==KeyEvent.KEYCODE_BACK){
            setResult(102);
            finish();
            return false;
        }else{
            return super.onKeyDown(keyCode, event);
        }
    }
}
